home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 342_01.zip / DIOFNC08.C < prev    next >
C/C++ Source or Header  |  1993-04-03  |  1KB  |  46 lines

  1. /*-
  2.  *  ----------------------------------------------------------------------
  3.  *  File        :   DIOFNC08.C
  4.  *  Creator     :   Blake Miller
  5.  *  Version     :   01.01.00        February 1991
  6.  *  Language    :   Microsoft C     Version 5.1
  7.  *  Purpose     :   Intel 8255 Compatible Digital IO Functions
  8.  *                  Read All 8255 Bytes
  9.  *  ----------------------------------------------------------------------
  10.  *  Revision History:
  11.  *  022891 BVM  :   Change int to short.
  12.  *  070490 BVM  :   Creation
  13.  *  ----------------------------------------------------------------------
  14.  */
  15.  
  16. #define     DIOFNC08_C_DEFINED
  17. #include    "DIOLIB.H"
  18. #undef      DIOFNC08_C_DEFINED
  19.  
  20. void dio_load_bytes (DIODAT *data);
  21.  
  22. /*- DIO : Load Bytes -------------------------**
  23.  *  Read all of the bytes of the 8255 into the data area.
  24.  *  Passed:
  25.  *      pointer :   DIODAT
  26.  *  Returns:
  27.  *      nothing
  28.  */
  29. void dio_load_bytes (DIODAT *data)
  30.     {
  31.     short           port;   /* port counter */
  32.     unsigned char   ival;   /* input value  */
  33.  
  34.     for ( port = 0; port < DIO_MAXCH; port++ ){
  35.         dio_bget ( data->base + port, &ival );
  36.         data->pdat[port] = ival;
  37.         }
  38.     data->stat = DIO_ST_OK;
  39.     }
  40.  
  41. /*-
  42.  *  ----------------------------------------------------------------------
  43.  *  END DIOFNC08.C Source File
  44.  *  ----------------------------------------------------------------------
  45.  */
  46.